package com.bolt.support.freemarker;

import freemarker.cache.ClassTemplateLoader;
import freemarker.cache.TemplateLoader;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

import java.util.List;

/**
 * Created by Administrator on 2017/9/15.
 */
public class ExtFreeMarkerConfigurer extends FreeMarkerConfigurer {

    @Override
    protected void postProcessTemplateLoaders(List<TemplateLoader> templateLoaders) {

        templateLoaders.add(new ClassTemplateLoader(FreeMarkerConfigurer.class, "/templates"));
        logger.info("ClassTemplateLoader for Spring macros added to FreeMarker configuration");
    }

}
